Skip to content

Introduce FiberMultiLock#83

Merged
vadimskipin merged 1 commit into
mainfrom
vskipin/multi-lock
Jun 19, 2026
Merged

Introduce FiberMultiLock#83
vadimskipin merged 1 commit into
mainfrom
vskipin/multi-lock

Conversation

@vadimskipin

Copy link
Copy Markdown
Collaborator

A keyed, fiber-aware lock over a uint64_t key space: the same key gives mutual exclusion, distinct keys proceed independently, and contenders for a held key are granted it in FIFO order. Non-reentrant.

Allocation-free like FiberCondVar - each acquisition's wait state lives in the caller's ScopedLock on the stack, so lock cannot fail and returns void. A SpinLock guards a Tree keyed by key; unlock promotes the front waiter and swaps it into the tree, preserving arrival order across handoffs.

A keyed, fiber-aware lock over a uint64_t key space: the same key gives
mutual exclusion, distinct keys proceed independently, and contenders for a
held key are granted it in FIFO order. Non-reentrant.

Allocation-free like FiberCondVar - each acquisition's wait state lives in
the caller's ScopedLock on the stack, so lock cannot fail and returns void.
A SpinLock guards a Tree<WaitEntry> keyed by key; unlock promotes the front
waiter and swaps it into the tree, preserving arrival order across handoffs.
@vadimskipin vadimskipin merged commit 539d53a into main Jun 19, 2026
14 checks passed
@vadimskipin vadimskipin deleted the vskipin/multi-lock branch June 19, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant